//package top.tenebrous.yzl.handler.authority;
//
//import org.springframework.beans.factory.InitializingBean;
//import org.springframework.stereotype.Component;
//import top.tenebrous.yzl.auth.AuthTokenGenerator;
//import top.tenebrous.yzl.chain.AbstractJesticChainHandler;
//import top.tenebrous.yzl.context.JesticTask;
//import top.tenebrous.yzl.context.Response;
//import top.tenebrous.yzl.enums.TaskEnum;
//import top.tenebrous.yzl.factorys.JesticPropertyChainFactory;
//import top.tenebrous.yzl.handler.AbstractJesticInitInterface;
//import top.tenebrous.yzl.instance.AbstractInstanceContext;
//import top.tenebrous.yzl.service.IAuthorityService;
//
//import javax.annotation.Resource;
//
///**
// * @Description:
// * @Project: jestic-server
// * @Package: com.tenebrous.jestic.factorys
// * @Author: zhangya
// * @CreateTime: 2023-06-29  14:14
// * @Version: 1.0.0
// */
//@Component
//public class JesticAuthorityInitHandler<T extends JesticTask, C extends Response> implements AbstractJesticInitInterface<T, C>, InitializingBean {
//
//    @Resource
//    private JesticPropertyChainFactory<T, C> jesticPropertyChainFactory;
//
//    @Resource
//    private IAuthorityService authorityService;
//
//    @Resource
//    private AbstractInstanceContext abstractInstanceContext;
//
//    @Resource
//    private AuthTokenGenerator authTokenGenerator;
//
//    @Override
//    public AbstractJesticChainHandler<T, C> buildBuilder() {
//        AbstractJesticChainHandler.Builder<T, C> builder = new AbstractJesticChainHandler.Builder<>();
//        return builder
//                .addHandler((AbstractJesticChainHandler<T, C>) new AuthorityHandler(authorityService, abstractInstanceContext, authTokenGenerator))
//                .build();
////        return builder.build();
//    }
//
//    @Override
//    public TaskEnum getTaskType() {
//        return TaskEnum.AUTHORITY;
//    }
//
//    @Override
//    public void afterPropertiesSet() throws Exception {
//        AbstractJesticChainHandler<T, C> handler = buildBuilder();
//        jesticPropertyChainFactory.register(getTaskType().getCode(), handler);
//    }
//}
